Click here to Skip to main content
15,887,477 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Remote Shell HTML interface Pin
TSrinivasR6-Feb-03 7:13
TSrinivasR6-Feb-03 7:13 
GeneralRe: Remote Shell HTML interface Pin
Abbas_Riazi5-Feb-03 22:07
professionalAbbas_Riazi5-Feb-03 22:07 
GeneralFree Gnu Makefiles for all Petzold programs Pin
John Kopplin5-Feb-03 6:16
John Kopplin5-Feb-03 6:16 
Generalpower to the people:zzz: Pin
Anonymous5-Feb-03 8:41
Anonymous5-Feb-03 8:41 
GeneralRe: power to the people:zzz: Pin
Anonymous5-Feb-03 17:11
Anonymous5-Feb-03 17:11 
GeneralRe: power to the people:zzz: Pin
Ben Burnett5-Feb-03 18:56
Ben Burnett5-Feb-03 18:56 
Generalnetbios names Pin
orcun colak5-Feb-03 6:10
orcun colak5-Feb-03 6:10 
GeneralRead Foxpro dbf files Pin
pk_fox5-Feb-03 5:52
pk_fox5-Feb-03 5:52 
Hello All,
I have a requirement to read Foxpro dbf files without using ODBC or any other sane methodology, I remember a long time ago I did this in C using a structure but It's so long ago I've forgotten. What I've tried so far is creating a class ( you might gather my C & C++ has gathered dust ) as below but it is not satisfactory ( fields overflowing etc... ). The sample table I've been using has three fields, clm_ref c(10), name c(50) and salary n(15,2),where c(2) is a character field of 2 chars and n(15,2) is a numeric field of 12 digits with precision of 2, here's what I've got so far.

Class Record
{
char filler[1]; */ required for deleted field */
char clm_ref[10];
char name[50];
char salary[15];
void RecordGetData(ifstream &);
};

Record::RecordGetData(ifstream f_in)
{
f_in.read((char*) this,sizeof(*this));
}


int main()
{
Record Claims;
ifstream ifile;
ifile.open("mydata.dbf");
DBF_HEAD dbf_head;
ifile.read((char*) &dbf_head,sizeof(DBF_HEAD)); */ Header info */
ifile.seekg(dbf_head.data_offset,ios::beg); */ seek to data offset*/
Claims.RecordGetData(ifile);

cout << "Claim ref " << Claims.clm_ref << endl;
}

While Claims.clm_ref contains the clm_ref data it also contains part of the name, I'm lost any ideas much appreciated

regards

Pete Kane









Pete Kane
GeneralRe: Read Foxpro dbf files Pin
Stefan Pedersen5-Feb-03 11:17
Stefan Pedersen5-Feb-03 11:17 
GeneralRe: Read Foxpro dbf files Pin
Mike Nordell5-Feb-03 21:09
Mike Nordell5-Feb-03 21:09 
GeneralRe: Read Foxpro dbf files Pin
pk_fox5-Feb-03 23:38
pk_fox5-Feb-03 23:38 
GeneralRe: Read Foxpro dbf files Pin
Mike Nordell12-Feb-03 9:24
Mike Nordell12-Feb-03 9:24 
GeneralWin9x error Pin
Anonymous5-Feb-03 5:34
Anonymous5-Feb-03 5:34 
GeneralRe: Win9x error Pin
David Chamberlain5-Feb-03 6:07
David Chamberlain5-Feb-03 6:07 
GeneralRe: Win9x error Pin
Joaquín M López Muñoz5-Feb-03 8:36
Joaquín M López Muñoz5-Feb-03 8:36 
GeneralRe: Win9x error Pin
Anonymous5-Feb-03 22:57
Anonymous5-Feb-03 22:57 
GeneralRe: Win9x error Pin
Anonymous5-Feb-03 23:00
Anonymous5-Feb-03 23:00 
GeneralErrors in createthread file. Need help! Pin
Pecan2045-Feb-03 5:24
Pecan2045-Feb-03 5:24 
GeneralRe: Errors in createthread file. Need help! Pin
Anonymous5-Feb-03 5:48
Anonymous5-Feb-03 5:48 
GeneralRe: Errors in createthread file. Need help! Pin
Anonymous5-Feb-03 5:56
Anonymous5-Feb-03 5:56 
GeneralRe: Errors in createthread file. Need help! Pin
-=jarl=-5-Feb-03 6:54
-=jarl=-5-Feb-03 6:54 
GeneralRe: Errors in createthread file. Need help! Pin
Pecan2045-Feb-03 8:15
Pecan2045-Feb-03 8:15 
GeneralGUI Dll Problems Pin
Ricky_TheBard5-Feb-03 5:08
Ricky_TheBard5-Feb-03 5:08 
GeneralGetDlgItem question. Pin
Maximilien5-Feb-03 4:13
Maximilien5-Feb-03 4:13 
GeneralRe: GetDlgItem question. Pin
Paul M Watt5-Feb-03 8:13
mentorPaul M Watt5-Feb-03 8:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.